package geometry;

import ru.ts.gisutils.geometry.IXY;

/**
 * Created by IntelliJ IDEA.
 * User: sigolaev_va
 * Date: 25.01.2013
 * Time: 15:22:01
 * Interface to line object containing 2 points, start one and end one
 */
public interface IXYLine
{
  /**
   * First point
   * @return {@link IXY) with a 1st point of the line
   */
  IXY startPoint();

  /**
   * Second point
   * @return {@link IXY) with a 2nd point of the line
   */
  IXY endPoint();

  /**
   * Distance from point
   * @param point {@link ru.ts.gisutils.geometry.IXY} to get distance
   * @return double with distance
   */
  double distance( IXY point);

  /**
   * Builds a new line connecting designated pnt and the line
   * @param pnt point to connect to the line with a shortest line
   * @return new {@link IXY} connecting designated point with this line line. Note that new line contain only new point
   */
  IXYLine connectLine(IXY pnt );

  /**
   * Length of this line
   * @return double with length of line
   */
  double length();

}